<%@ page import="com.dingpeikeji.quickdeer.core.modules.sys.entity.Office" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="FLAT_TYPE_ENTERPRISE" value="<%=Office.FLAT_TYPE_ENTERPRISE %>" />
<html>
<head>
	<title>授信额度管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/office/credit/">授信额度列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="office" action="${ctx}/office/credit/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>合作伙伴：</label>
				<sys:treeselect id="office" name="id" value="${office.id}" labelName="name" labelValue="${office.name}"
					title="合作伙伴" url="/sys/office/treeData?type=2&flatType=${FLAT_TYPE_ENTERPRISE }" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>合作伙伴</th>
				<th>月授信额度</th>
				<th>总授信额度</th>
				<th>当前月使用额度</th>
				<th>当年使用总额度</th>
				<shiro:hasPermission name="rentproduct:tOfficeCredit:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="credit">
			<tr>
				<td><a href="${ctx}/office/credit/form?id=${credit.id}">
					${credit.name}
				</a></td>
				<td>
					<fmt:formatNumber value="${credit.monthcredit}" pattern="￥#.##" minFractionDigits="2" />
				</td>
				<td>
					<fmt:formatNumber value="${credit.totalcredit}" pattern="￥#.##" minFractionDigits="2" />
				</td>
				<td>
					<fmt:formatNumber value="${credit.creditInMonth}" pattern="￥#.##" minFractionDigits="2" />
				</td>
				<td>
					<fmt:formatNumber value="${credit.creditInYear}" pattern="￥#.##" minFractionDigits="2" />
				</td>
				<shiro:hasPermission name="rentproduct:tOfficeCredit:edit"><td>
    				<a href="${ctx}/office/credit/form?id=${credit.id}">修改</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>